package com.itheima.stock.mapper;

import com.itheima.stock.pojo.domain.StockBusinessDomain;
import com.itheima.stock.pojo.entity.StockBusiness;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author 46035
 * @description 针对表【stock_business(主营业务表)】的数据库操作Mapper
 * @createDate 2022-09-19 15:48:56
 * @Entity com.itheima.stock.pojo.entity.StockBusiness
 */
public interface StockBusinessMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockBusiness record);

    int insertSelective(StockBusiness record);

    StockBusiness selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockBusiness record);

    int updateByPrimaryKey(StockBusiness record);

    /**
     * 获取所有股票的code
     *
     * @return
     */
    List<String> getAllStockCodes();

    /**
     * 获取个股主营业务
     *
     * @param code
     * @return
     */
    StockBusinessDomain getStockDescribe(@Param("code") String code);

    /**
     * 根据输入的个股代码，进行模糊查询，返回证券代码和证券名称
     *
     * @param toCharArray
     * @return
     */
    List<Map> stockSearchObscure(@Param("strs") char[] toCharArray);
}
